package com.kaka.bus.engine.rechange;

import com.kaka.bus.bean.HttpWrapper;
import com.kaka.bus.constant.Constant;
import com.kaka.bus.di.DataManager;
import com.kaka.bus.manager.Result;
import com.kaka.bus.manager.T;
import com.kaka.bus.mvp.RxPresenter;

import javax.inject.Inject;

public class GoRechangePresenter extends RxPresenter<GoRechangeContract.View> implements GoRechangeContract.Presenter {


    @Inject
    public GoRechangePresenter(DataManager dataManager) {
        super(dataManager);
    }

    @Override
    public void getcheckPayFee(int productId) {
        mView.showDialog(Constant.LOAD);
        addSubscribe(mDataManager
                .getApi()
                .getcheckPayFee(productId)
                .compose(T.D())
                .subscribeWith(new Result<HttpWrapper<String>>() {
                    @Override
                    protected void onSuccess(HttpWrapper<String> s) {
                        mView.getcheckPayFeeSuccess(s);
                    }

                    @Override
                    protected void onFinish() {
                        super.onFinish();
                        mView.dissDialog();
                    }
                }));

    }

}
